package com.huike.clues.service.impl;

import com.huike.clues.domain.SysNotice;
import com.huike.clues.mapper.ISysNoticeMapper;
import com.huike.clues.service.ISysNoticeService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @Description TODO
 * @Author yy
 * @Date 2023-07-11 23:55
 */
@Service
public class SysNoticeServiceImpl implements ISysNoticeService {


    @Resource
    private ISysNoticeMapper isysNoticeMapper;
    /**
     * 获取系统提醒下拉列表
     * @param status
     * @return
     */
    @Override
    public List<SysNotice> NoticeList(String status) {
        List<SysNotice> list =isysNoticeMapper.NoticeList(status);
        return list;
    }


    @Override
    public List<SysNotice> pageList(String status) {
        return isysNoticeMapper.pageList(status);
    }

    /**
     * 获取详情信息
     * @param noticeId
     * @return
     */
    @Override
    public SysNotice noticeId(Integer noticeId) {
        SysNotice sysNotice = isysNoticeMapper.noticeId(noticeId);
        return sysNotice;
    }


    /**
     * 未读变已读
     * @param noticeId
     */
    @Override
    public void noticeById(Integer noticeId) {
        SysNotice sysNotice = isysNoticeMapper.findById(noticeId);
        if (sysNotice.getStatus().equals(0))
        isysNoticeMapper.noticeById(noticeId);
    }
}
